﻿Public Class frm_add_md5

    Private _item As String = String.Empty

    Public Property GetSetItem As String
        Set(value As String)
            _item = value
        End Set
        Get
            Return _item
        End Get
    End Property


    Private Sub txt_hash_TextChanged(sender As Object, e As EventArgs) Handles txt_hash.TextChanged

        Dim _tools As New Tools

        If _tools.isValidMD5(txt_hash.Text.ToLower) Then
            pb_status.Image = My.Resources.OK
            lbl_status.Text = "OK - Gültiger MD5 Hash"
            cmd_ok.Enabled = True
        Else
            pb_status.Image = My.Resources.Warning
            lbl_status.Text = "Bitte geben Sie einen gültigen MD5 Hash ein!"
            cmd_ok.Enabled = False
        End If

    End Sub

    Private Sub cmd_ok_Click(sender As Object, e As EventArgs) Handles cmd_ok.Click

        frm_main.lv_sfdl_container.FindItemWithText(_item).SubItems(2).Text = txt_hash.Text.ToLower

        Me.Close()

    End Sub
End Class